import request from '@/utils/request'

// 广告列表
export const fetchAdvertiseList = (params) => {
    return request({
        url: '/home/advertise/list',
        method: 'get',
        params: params
    })
}

// 更新广告状态
export const updateAdvertiseStatus = (id, params) => {
    return request({
        url: '/home/advertise/update/status/' + id,
        method: 'post',
        params: params
    })
}

// 删除广告
export const deleteAdvertise = (data) => {
    return request({
        url: '/home/advertise/delete',
        method: 'post',
        data: data
    })
}

// 创建广告
export const createAdvertise = (data) => {
    return request({
        url: '/home/advertise/create',
        method: 'post',
        data: data
    })
}

// 获取广告详情
export const getAdvertise = (id) => {
    return request({
        url: '/home/advertise/' + id,
        method: 'get',
    })
}

// 更新广告
export const updateAdvertise = (id, data) => {
    return request({
        url: '/home/advertise/update/' + id,
        method: 'post',
        data: data
    })
}

